/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cms.action.adminaction;

import cms.sessionbean.ConferenceItemApplicationRemote;
import cms.sessionbean.UserPortfoiloRemote;
import cms.util.EjbLocator;
import dto.Conferenceitem;
import dto.Reviewcategory;
import dto.User;
import java.util.List;
import model.ConferenceModel;
import model.ReviewerModel;

/**
 *
 * @author eichawsan
 */
public class ReviewMgmtAction {
    
  private String itemName;
  private String conferenceName;
  private String itemType;

    public String getItemType() {
        return itemType;
    }

    public void setItemType(String itemType) {
        this.itemType = itemType;
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public String getConferenceName() {
        return conferenceName;
    }

    public void setConferenceName(String conferenceName) {
        this.conferenceName = conferenceName;
    }

    public List<User> getReviewerList() {
        return reviewerList;
    }

    public void setReviewerList(List<User> reviewerList) {
        this.reviewerList = reviewerList;
    }

    public List<ReviewerModel> getReviewerModel() {
        return reviewerModel;
    }

    public void setReviewerModel(List<ReviewerModel> reviewerModel) {
        this.reviewerModel = reviewerModel;
    }
  private List<User> reviewerList;
  private List<ReviewerModel> reviewerModel;
  private List<Reviewcategory> categories; 

    public List<Reviewcategory> getCategories() {
        return categories;
    }

    public void setCategories(List<Reviewcategory> categories) {
        this.categories = categories;
    }
    
    public ReviewMgmtAction() {
    }
    
    public String execute() throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
    private ConferenceItemApplicationRemote itemRemote = (ConferenceItemApplicationRemote)EjbLocator.getInstance().LookUpBeanByName(ConferenceItemApplicationRemote.class, "ConferenceItemApplication");
    private  UserPortfoiloRemote userRemote =  (UserPortfoiloRemote) EjbLocator.getInstance().LookUpBeanByName(UserPortfoiloRemote.class, "UserPortfoilo");
    
     public String showReviewers()
    {
         Conferenceitem item =   itemRemote.getConfercenItems(itemName).get(0);
         this.itemType =ConferenceModel.GetConferenceItemType(item.getCategory());
         this.reviewerList = userRemote.getAllUsers("member");
//        List<User> users = new ArrayList<User>();
//        User user=new User("eichaw","eichaw","reviewer");
//        users.add(user);
//        
//        user=new User("hx","hx","reviewer");
//        users.add(user);
//        
//        reviewerModel=ConferenceModel.ConvertReviewerModelList(users);
       
        return "reviewerList";
    }
}
